var http = require('http');

var server = http.createServer(function(req, res) {

    res.writeHead(200, {
        'Content-Type': 'text/html;charset=utf-8'
    });
    res.write('<h1>hello, world!</h1>');
    res.end();

});

server.listen(8080, function(err) {
    if (!err) {
        console.log("服务器已经运行: 端口号是: 3000");
    }
})